package com.yq.model;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseVO {
    private String msg;
    private int status;
    private  Object data;
    public  static  BaseVO ok(){
        BaseVO baseVO = new BaseVO();
        baseVO.setStatus(200);
        baseVO.setMsg("成功");
        return baseVO;
    }
    public  static  BaseVO ok(Object data){
        BaseVO baseVO = new BaseVO();
        baseVO.setStatus(200);
        baseVO.setMsg("成功");
        baseVO.setData(data);
        return baseVO;
    }

    public  static  BaseVO error(){
        BaseVO baseVO = new BaseVO();
        baseVO.setStatus(404);
        baseVO.setMsg("失败");
        return baseVO;
    }

    public  static  BaseVO error(String msg){
        BaseVO baseVO = new BaseVO();
        baseVO.setStatus(404);
        baseVO.setMsg(msg);
        return baseVO;
    }
}
